<include file="Public:header"/>
<div id="main-content">
    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
        <button class="close fixed" style="margin-top: 4px;">&times;</button>
        <div class="alert-content">警告内容</div>
    </div>
    <div id="main" class="main">
        <div class="main-title-h">
            <span class="h1-title">基本配置</span>
        </div>
        <div class="tab-wrap">
            <div class="tab-content">

                <form id="form" action="{:U('Article/confEdit')}" method="post" class="form-horizontal" enctype="multipart/form-data">
                    <div id="tab" class="tab-pane in tab">
                        <div class="form-item cf">
                            <table>

                                <tr class="controls">
                                    <td class="item-label">用户注册协议 :</td>
                                    <td style=" padding-bottom:10px;">
                                        <textarea name="web_reg" id="web_reg" class="form-control input-10x">{$data.web_reg}</textarea>
                                    </td>
                                    <td class="item-note"></td>
                                </tr>

                                <tr class="controls">
                                    <td class="item-label"></td>
                                    <td>
                                        <div class="form-item cf">
                                            <button class="btn submit-btn ajax-post" target-form="form-horizontal" id="submit" type="submit">提交</button>
                                            <a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </form>
                <script type="text/javascript">
                    //提交表单
                    $('#submit').click(function () {
                        $('#form').submit();
                    });
                </script>
            </div>
        </div>
    </div>
</div>

<script charset="utf-8" src="__PUBLIC__/kindeditorv4/kindeditor-all-min.js"></script>
<script charset="utf-8" src="__PUBLIC__/kindeditorv4//lang/zh-CN.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        //响应文件添加成功事件
        $("#inputfile").change(function () {
            //创建FormData对象
            var data = new FormData();
            //为FormData对象添加数据
            $.each($('#inputfile')[0].files, function (i, file) {
                data.append('upload_file' + i, file);
            });


            //发送数据
            $.ajax({
                url: '/Admin/Config/image',
                type: 'POST',
                data: data,
                cache: false,
                contentType: false,		//不可缺参数
                processData: false,		//不可缺参数
                success: function (data) {
                    if (data) {
                        $('#up_img').attr("src", '/Upload/public/' + $.trim(data));
                        $('#img').val($.trim(data));
                        $('#up_img').show();
                    }
                },
                error: function () {
                    alert('上传出错');
                    $(".loading").hide();	//加载失败移除加载图片
                }
            });

        });
    });
    $(document).ready(function () {
        //响应文件添加成功事件
        $("#inputfilewx").change(function () {
            //创建FormData对象
            var data = new FormData();
            //为FormData对象添加数据
            $.each($('#inputfilewx')[0].files, function (i, file) {
                data.append('upload_file' + i, file);
            });


            //发送数据
            $.ajax({
                url: '/Admin/Config/image',
                type: 'POST',
                data: data,
                cache: false,
                contentType: false,		//不可缺参数
                processData: false,		//不可缺参数
                success: function (data) {
                    if (data) {
                        $('#up_imgwx').attr("src", '/Upload/public/' + $.trim(data));
                        $('#imgwx').val($.trim(data));
                        $('#up_imgwx').show();
                    }
                },
                error: function () {
                    alert('上传出错');
                    $(".loading").hide();	//加载失败移除加载图片
                }
            });

        });
    });

    $(document).ready(function () {
        //响应文件添加成功事件
        $("#inputfileb").change(function () {
            //创建FormData对象
            var data = new FormData();
            //为FormData对象添加数据
            $.each($('#inputfileb')[0].files, function (i, file) {
                data.append('upload_file' + i, file);
            });


            //发送数据
            $.ajax({
                url: '/Admin/Config/image',
                type: 'POST',
                data: data,
                cache: false,
                contentType: false,		//不可缺参数
                processData: false,		//不可缺参数
                success: function (data) {
                    if (data) {
                        $('#up_imgb').attr("src", '/Upload/public/' + $.trim(data));
                        $('#imgb').val($.trim(data));
                        $('#up_imgb').show();
                    }
                },
                error: function () {
                    alert('上传出错');
                    $(".loading").hide();	//加载失败移除加载图片
                }
            });

        });
    });

    $(document).ready(function () {
        //响应文件添加成功事件
        $("#inputfilea").change(function () {
            //创建FormData对象
            var data = new FormData();
            //为FormData对象添加数据
            $.each($('#inputfilea')[0].files, function (i, file) {
                data.append('upload_file' + i, file);
            });


            //发送数据
            $.ajax({
                url: '/Admin/Config/image',
                type: 'POST',
                data: data,
                cache: false,
                contentType: false,		//不可缺参数
                processData: false,		//不可缺参数
                success: function (data) {
                    if (data) {
                        $('#up_imga').attr("src", '/Upload/public/' + $.trim(data));
                        $('#imga').val($.trim(data));
                        $('#up_imga').show();
                    }
                },
                error: function () {
                    alert('上传出错');
                    $(".loading").hide();	//加载失败移除加载图片
                }
            });

        });
    });
</script>

<script type="text/javascript">

    // KindEditor.ready(function(K) {
    //     window.editor = K.create('#web_reg');
    // });
    var editor;
    KindEditor.ready(function (K) {
        editor = K.create('textarea[name="web_reg"]', {
            width: '500px',
            height: '100px',
            allowImageUpload: true,
            items: [
                'source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                'insertunorderedlist', '|', 'emoticons', 'link', 'fullscreen'],
            afterBlur: function () {

                editor.sync();
            }
        });
        editors = K.create('textarea[name="en_web_reg"]', {
            width: '500px',
            height: '100px',
            allowPreviewEmoticons: false,
            allowImageUpload: true,
            items: [
                'source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                'insertunorderedlist', '|', 'emoticons', 'link', 'fullscreen'],
            afterBlur: function () {
                this.sync();
            }
        });
    });
</script>
<include file="Public:footer"/>